home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-05-25 | 3.3 KB | 109 lines | [TEXT/GEOL] |
- Item 8555043 24-May-90 02:36PDT
-
- From: MADA2 MacApp Dev Assoc, Curtis Faith,IVC
-
- To: MACAPP.TECH$ MacApp Technical
- MACAPP.TEST MacApp SQA Team
- MACDTS Macintosh Developer Tech Supt
-
- Sub: MacApp Final Bugs/Comments
-
- I just received MacApp final from APDA and thought I would mention the
- following:
-
- 1) Modeless TDialogViews don't Dismiss when a TControl that fDismisses is
- pressed. What happens is that TDialogView properly calls DismissDialog, but
- all that DismissDialog does is set fDismissed to TRUE and set the fDismisser
- field to the view that was passed in.
-
- Pressing a "dismisses" button, for example, does not dismiss when a Window is
- opened with a call to TWindow.Open instead of TDialogView.PoseModally. Only
- PoseModally uses the fDismissed field.
-
- This really limits the usefulness of modeless dialogs.
-
- One workaround is to OVERRIDE TDialogView:
-
- a) Add a field fDismissClosesWindow: Boolean;
-
- b) OVERRIDE PoseModally to set fDismissClosesWindow to FALSE before its repeat
- loop and set it to TRUE after.
-
- c) OVERRIDE Close with:
- fDismissClosesWindow := FALSE;
- INHERITED Close;
-
- This is to avoid recursive calls to close, because close calls
- DismissDialog which would otherwise call GetWindow.Close resulting in a further
- call to SELF.Close etc., etc., etc.
-
- d) OVERRIDE DismissDialog adding this line after "fDismisser := dismisser":
- IF fDismissClosesWindow THEN
- GetWindow.Close;
-
- e) OVERRIDE IRes and IDialogView to set fDismissClosesWindow to TRUE.
-
- That should do it.
-
- I personally consider this to be a bug!
-
- 2) TDialogView will call DoChoice on a button that is disabled as the result of
- a key press. If one disables the default button and presses return for
- example, the button's DoChoice method still gets called!
-
- IF defaultView.IsViewEnabled THEN
- TControl(defaultView).Flash;
- TControl(defaultView).DoChoice(defaultView,TControl(defaultView).fDefChoice);
-
- Should be replaced by:
-
- IF defaultView.IsViewEnabled THEN
- BEGIN
- TControl(defaultView).Flash;
- TControl(defaultView).DoChoice(defaultView,TControl(defaultView).fDefChoice);
- END;
-
- You can do this in the same TDialogView OVERRIDE as above if you hesitate to
- change MacApp.
-
- I definately would call this one a bug!
-
- 3) This is not really a bug but, if you used to call FreeAll on the fSubviews
- field of a View this will no longer work. What happens is this:
-
- FreeAll calls:
-
- Each(FreeIfObject);
- DeleteAll;
-
- in the process of freeing each subview TView.RemoveSubview checks to see if the
- fSubViews list is empty if it is then it FreeIfObject's it and sets the
- fSubViews field to NIL. This has the nasty effect of confusing fSubViews which
- is in the middle of executing its method when it is freed, it Bombs wonderfully
- at DeleteAll.
-
- To Remove all subviews you now need to do this:
-
- Declare a local procedure:
-
- PROCEDURE RemoveAndFree (aSubView: TView);
- BEGIN
- RemoveSubView(aSubView);
- FreeIfObject(aSubView);
- END;
-
- Then call:
-
- IF fSubViews <> NIL THEN
- fSubViews.Each(RemoveAndFree);
-
- On the whole the new functionality is probably better anyway, but I thought I
- would warn anyone who might run into this problem.
-
- I remain as always,
-
- Befuddled but Merry,
-
- Curtis
-
-